package com.hongning.railway.ui.main.mine.partymember.itemviewmodel;

import android.databinding.ObservableField;
import android.os.Bundle;
import android.support.annotation.NonNull;

import com.hongning.railway.entity.reqbean.QuestionResultBean;
import com.hongning.railway.ui.main.fragments.threesessionsandonelesson.ThreesessionSanDoneLessonFragmentInfo;
import com.hongning.railway.ui.main.mine.partymember.PartyQuestionFragment;
import com.hongning.railway.ui.main.mine.partymember.QuestionFragmentViewModel;

import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class QuestionItemViewModel extends ItemViewModel<QuestionFragmentViewModel> {
    public ObservableField<QuestionResultBean> questionResultBeanObservableField = new ObservableField<>();
    public BindingCommand itemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            Bundle bundle = new Bundle();
            bundle.putSerializable("QuestionResultBean",questionResultBeanObservableField.get());
            viewModel.startContainerActivity(PartyQuestionFragment.class.getCanonicalName(),bundle);
        }
    });
    public QuestionItemViewModel(@NonNull QuestionFragmentViewModel viewModel, QuestionResultBean questionResultBean) {
        super(viewModel);
        questionResultBeanObservableField.set(questionResultBean);
    }
}
